package com.example.demo.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.demo.bean.CmsComment;

import com.example.demo.mapper.CmsCommentMapper;

@Service
public class CmsCommentService {
	@Autowired
	private CmsCommentMapper commentmapper;
	
	public List<CmsComment> getAllComment() {
		List<CmsComment> list=commentmapper.selectAll();
		return list;
	}

	public int deleteById(String id) {
		return commentmapper.deleteByPrimaryKey(id);
	}

	public boolean updateState(String comId, String state) {
		int result=commentmapper.updateStateById(comId, state);
		if(result==0) {
			return false;
		}
		return true;
	}

}
